Skip to content

Conversation

@masseyke
Copy link
Member

If a yaml rest spec file is empty or otherwise has no field name, the rest spec parser will get stuck in an infinite loop. This change intentionally throws an error in that loop if it can't possibly proceed.

@masseyke masseyke added >non-issue :Core/Infra/REST API REST infrastructure and utilities v9.1.0 labels May 22, 2025
@masseyke masseyke marked this pull request as ready for review May 22, 2025 19:18
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label May 22, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@masseyke
Copy link
Member Author

This one is pretty easy to reproduce. I ran into it by forgetting that I had put an empty file at rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_data_stream_mappings.json, and then running a yaml rest test, like:

./gradlew ':modules:data-streams:yamlRestTest' --tests "org.elasticsearch.datastreams.DataStreamsClientYamlTestSuiteIT.test {p0=data_stream/240_data_stream_settings/*}"

@masseyke masseyke added the auto-backport Automatically create backport pull requests when merged label May 22, 2025
@masseyke masseyke merged commit 4c6b141 into elastic:main May 22, 2025
18 checks passed
@masseyke masseyke deleted the avoid-infinite-hang-in-yaml-rest-tests branch May 22, 2025 20:27
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged :Core/Infra/REST API REST infrastructure and utilities >non-issue Team:Core/Infra Meta label for core/infra team v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants